require("utils.functions")

disable_global()

require("utils.init")

local function __G__TRACKBACK__(message)
    --
    local traceback = debug.traceback()
    local errors = "\nERROR: " .. message .. "\n"
    errors = errors .. ">>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
    errors = errors .. traceback .. "\n"
    errors = errors .. "<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"

    printDebug(errors)
end

local function main()
    math.randomseed(os.time())
    printDebug("go to main")
    -- local loadView = G_UIManager:openWindow("LoadView")
    -- G_ResourceManager:checkUpdate(
    --     function(status)
    -- if status <= 3 then
    -- G_UIManager:popWindow()
    -- G_UIManager:openWindow("LoginView")
    -- else
    --     loadView:setTextTips(Lang.get("res_load_failed"))
    --     loadView:updateBar(0, 0)
    -- end
    --     end,
    --     function(curProgress, totalProgress)
    --         loadView:updateBar(curProgress, totalProgress)
    --     end
    -- )
end

local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
    printDebug(msg)
end
